home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Camelot
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].zip
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].adf
/
XLisp-Stat
/
Functions
/
showcoord.lsp
< prev
next >
Wrap
Text File
|
1990-10-11
|
985b
|
30 lines
; book pp.274-275
(send graph-proto :add-mouse-mode 'show-coordinates
:title "Show Coordinates"
:click :do-show-coordinates
:cursor 'finger)
#| canvas coordinates
(defmeth graph-proto :do-show-coordinates (x y n1 n2)
(let ((s (format nil "~s" (list x y)))
(mode (send self :draw-mode)))
(send self :draw-mode 'xor)
(send self :draw-string s x y)
(send self :while-button-down #'(lambda (x y) nil))
(send self :draw-string s x y)
(send self :draw-mode mode)))
|#
(defmeth graph-proto :do-show-coordinates (x y m1 m2)
(let* ((xy (cond (m1 (send self :canvas-to-real x y))
(m2 (send self :canvas-to-scaled x y))
(t (list x y))))
(s (format nil "~s" xy))
(mode (send self :draw-mode)))
(send self :draw-mode 'xor)
(send self :draw-string s x y)
(send self :while-button-down #'(lambda (x y) nil))
(send self :draw-string s x y)
(send self :draw-mode mode)))